var win = Titanium.UI.currentWindow;
var mapview = null;

Titanium.Geolocation.getCurrentPosition(function(e) {
	if (e.error) {
		// manage the error
		return;
	}

	longitude = e.coords.longitude;
	latitude = e.coords.latitude;
	var altitude = e.coords.altitude;
	var heading = e.coords.heading;
	var accuracy = e.coords.accuracy;
	var speed = e.coords.speed;
	var timestamp = e.coords.timestamp;
	var altitudeAccuracy = e.coords.altitudeAccuracy;

            // we use the above data the way we need it
	
	mapview = Titanium.Map.createView({
		top:20,
		height:300,
		mapType: Titanium.Map.STANDARD_TYPE,
		region:{latitude:latitude, longitude:longitude, latitudeDelta:0.5, longitudeDelta:0.5},
		animate:true,
		regionFit:true,
		userLocation:true,
	    backgroundColor:'#0f0'
	});
	
	
	
});



/*

var myMapView = Titanium.UI.createView({
    backgroundColor:'#f00'

});
*/

win.add(mapview);
